import { OpenUserModel } from '@/models/dtos/OpenUserModel'
import { LoginResultVo } from '@/models/userinfo/LoginResultVo'
import { http } from '@/utils/http'
/**
 * 开放平台登录接口
 * @param 用户名
 * @param 密码
 * @returns  用户信息和token
 */
export async function openLogin(loginModel: OpenUserModel) {
    return await http.post<LoginResultVo>("/open/openlogin", loginModel)
}
/**
 * 
 * @returns 测试登录
 */
export async function testLogin() {
    return await http.get<LoginResultVo>("/open/testlogin")
}

/**
 * 保存用户方案配置
 * @param key 
 * @param config 
 * @returns 
 */
export async function saveUserPlanCOnfig(key: string, config: string,name:string) {
    return await http.post("/db/save/user/plan/config", { key, config,name });
}

export async function getUserPlanConfig(configId:string){
    return await http.get("/db/get/user/plan/config/"+configId);
}